@echo off
title Setup Maven
echo.
echo ====================================
echo   Manual Maven Setup
echo ====================================
echo.

echo Step 1: Create directories
if not exist ".mvn" mkdir .mvn
if not exist ".mvn\wrapper" mkdir .mvn\wrapper

echo.
echo Step 2: Please manually download maven-wrapper.jar
echo.
echo 1. Open this URL in your browser:
echo https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
echo.
echo 2. Save the file to this location:
echo %CD%\.mvn\wrapper\maven-wrapper.jar
echo.
echo 3. After downloading, press any key to continue...
pause

echo.
echo Checking if maven-wrapper.jar exists...
if exist ".mvn\wrapper\maven-wrapper.jar" (
    echo ✅ Maven wrapper found!
    echo File size:
    dir ".mvn\wrapper\maven-wrapper.jar" | findstr "maven-wrapper"
    echo.
    echo Now you can run: mvnw.cmd --version
) else (
    echo ❌ Maven wrapper not found
    echo Please make sure you downloaded the file to the correct location
)

echo.
pause